package com.company;

import java.util.Scanner;

public class Task0 {
    public static void main(String[] args) {
        //todo 0.写一段会员打折的程序代码，规则如下：
        // 1级会员消费满100打9折；2级会员消费满100打8折，满200打7.5折
        // 3级会员消费满100打7折，满200打6.5折，满300打6折；
        // 非会员消费满500打9折；

        double discount = 1;//折扣

        System.out.println("请输入会员等级（0-3的整数，0为非会员）：");
        Scanner scanner = new Scanner(System.in);
        int level = Integer.parseInt(scanner.next());
        System.out.println("请输入买单金额：");
        Scanner scanner2 = new Scanner(System.in);
        double money = Integer.parseInt(scanner2.next());//本次买单金额

        switch (level) {
            case 1:
                if (money >= 100) {
                    discount = 0.9;
                }
                break;
            case 2:
                if (money >= 200) {
                    discount = 0.75;
                }else if (money >= 100) {
                    discount = 0.8;
                }
                break;
            case 3:
                if (money >= 300) {
                    discount = 0.6;
                } else if (money >= 200) {
                    discount = 0.65;
                } else if (money >= 100) {
                    discount = 0.7;
                }
                break;
            default:
                if (money >= 500) {
                    discount = 0.9;
                }
                break;
        }

        System.out.println("本次消费的金额为：" + (money * discount));
    }
}
